home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / qrprntr.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  34.5 KB  |  956 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'qrprntr.pas' rev: 3.00
  6.  
  7. #ifndef qrprntrHPP
  8. #define qrprntrHPP
  9. #include <Dialogs.hpp>
  10. #include <qr2const.hpp>
  11. #include <DBTables.hpp>
  12. #include <Db.hpp>
  13. #include <Forms.hpp>
  14. #include <Graphics.hpp>
  15. #include <Printers.hpp>
  16. #include <Buttons.hpp>
  17. #include <ComCtrls.hpp>
  18. #include <ExtCtrls.hpp>
  19. #include <StdCtrls.hpp>
  20. #include <Controls.hpp>
  21. #include <Classes.hpp>
  22. #include <Messages.hpp>
  23. #include <SysUtils.hpp>
  24. #include <WinSpool.hpp>
  25. #include <Windows.hpp>
  26. #include <SysInit.hpp>
  27. #include <System.hpp>
  28.  
  29. //-- user supplied -----------------------------------------------------------
  30.  
  31. namespace Qrprntr
  32. {
  33. //-- type declarations -------------------------------------------------------
  34. enum TQRPaperSize { Default, Letter, LetterSmall, Tabloid, Ledger, Legal, Statement, Executive, A3, 
  35.     A4, A4Small, A5, B4, B5, Folio, Quarto, qr10X14, qr11X17, Note, Env9, Env10, Env11, Env12, Env14, CSheet, 
  36.     DSheet, ESheet, Custom };
  37.  
  38. enum TQRBin { First, Upper, Lower, Middle, Manual, Envelope, EnvManual, Auto, Tractor, SmallFormat, 
  39.     LargeFormat, LargeCapacity, Cassette, Last };
  40.  
  41. enum TQRBandType { rbTitle, rbPageHeader, rbDetail, rbPageFooter, rbSummary, rbGroupHeader, rbGroupFooter, 
  42.     rbSubDetail, rbColumnHeader, rbOverlay, rbChild };
  43.  
  44. class DELPHICLASS EQRError;
  45. class PASCALIMPLEMENTATION EQRError : public Sysutils::Exception 
  46. {
  47.     typedef Sysutils::Exception inherited;
  48.     
  49. public:
  50.     /* Exception.Create */ __fastcall EQRError(const System::AnsiString Msg) : Sysutils::Exception(Msg)
  51.          { }
  52.     /* Exception.CreateFmt */ __fastcall EQRError(const System::AnsiString Msg, const System::TVarRec * 
  53.         Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  54.     /* Exception.CreateRes */ __fastcall EQRError(int Ident, Extended Dummy) : Sysutils::Exception(Ident
  55.         , Dummy) { }
  56.     /* Exception.CreateResFmt */ __fastcall EQRError(int Ident, const System::TVarRec * Args, const int 
  57.         Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  58.     /* Exception.CreateHelp */ __fastcall EQRError(const System::AnsiString Msg, int AHelpContext) : Sysutils::
  59.         Exception(Msg, AHelpContext) { }
  60.     /* Exception.CreateFmtHelp */ __fastcall EQRError(const System::AnsiString Msg, const System::TVarRec 
  61.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  62.         ) { }
  63.     /* Exception.CreateResHelp */ __fastcall EQRError(int Ident, int AHelpContext) : Sysutils::Exception(
  64.         Ident, AHelpContext) { }
  65.     /* Exception.CreateResFmtHelp */ __fastcall EQRError(int Ident, const System::TVarRec * Args, const 
  66.         int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
  67.     
  68. public:
  69.     /* TObject.Destroy */ __fastcall virtual ~EQRError(void) { }
  70.     
  71. };
  72.  
  73. typedef Word CodeType;
  74.  
  75. typedef Byte UpIndex;
  76.  
  77. typedef Word DownIndex;
  78.  
  79. typedef DownIndex TreeDownArray[256];
  80.  
  81. typedef UpIndex TreeUpArray[513];
  82.  
  83. class DELPHICLASS TQRPrinter;
  84. class DELPHICLASS TPrinterSettings;
  85. typedef bool TPaperSizesSupported[27];
  86.  
  87. class PASCALIMPLEMENTATION TPrinterSettings : public System::TObject 
  88. {
  89.     typedef System::TObject inherited;
  90.     
  91. private:
  92.     char *FDevice;
  93.     char *FDriver;
  94.     char *FPort;
  95.     int DeviceMode;
  96.     _devicemodeA *DevMode;
  97.     int FCopies;
  98.     bool FDuplex;
  99.     int FMaxExtentX;
  100.     int FMaxExtentY;
  101.     int FMinExtentX;
  102.     int FMinExtentY;
  103.     TPrinterOrientation FOrientation;
  104.     TQRBin FOutputBin;
  105.     TQRPaperSize FPaperSize;
  106.     bool FPaperSizes[27];
  107.     int FPaperWidth;
  108.     int FPaperLength;
  109.     int FPixelsPerX;
  110.     int FPixelsPerY;
  111.     int FTopOffset;
  112.     int FLeftOffset;
  113.     Printers::TPrinter* FPrinter;
  114.     System::AnsiString FTitle;
  115.     int __fastcall GetCopies(void);
  116.     System::AnsiString __fastcall GetDriver(void);
  117.     bool __fastcall GetDuplex(void);
  118.     int __fastcall GetMaxExtentX(void);
  119.     int __fastcall GetMaxExtentY(void);
  120.     int __fastcall GetMinExtentX(void);
  121.     int __fastcall GetMinExtentY(void);
  122.     Printers::TPrinterOrientation __fastcall GetOrientation(void);
  123.     TQRBin __fastcall GetOutputBin(void);
  124.     TQRPaperSize __fastcall GetPaperSize(void);
  125.     bool __fastcall GetPaperSizeSupported(TQRPaperSize PaperSize);
  126.     int __fastcall GetPaperWidth(void);
  127.     int __fastcall GetPaperLength(void);
  128.     int __fastcall GetPixelsPerX(void);
  129.     int __fastcall GetPixelsPerY(void);
  130.     System::AnsiString __fastcall GetPort(void);
  131.     Printers::TPrinter* __fastcall GetPrinter(void);
  132.     System::AnsiString __fastcall GetTitle(void);
  133.     int __fastcall GetTopOffset(void);
  134.     int __fastcall GetLeftOffset(void);
  135.     bool __fastcall Supported(int Setting);
  136.     void __fastcall SetField(int aField);
  137.     void __fastcall GetPrinterSettings(void);
  138.     void __fastcall SetCopies(int Value);
  139.     void __fastcall SetDuplex(bool Value);
  140.     void __fastcall SetOrientation(Printers::TPrinterOrientation Value);
  141.     void __fastcall SetOutputBin(TQRBin Value);
  142.     void __fastcall SetPaperSize(TQRPaperSize Value);
  143.     void __fastcall SetPaperLength(int Value);
  144.     void __fastcall SetPaperWidth(int Value);
  145.     void __fastcall SetPrinter(Printers::TPrinter* Value);
  146.     void __fastcall SetTitle(System::AnsiString Value);
  147.     
  148. public:
  149.     __fastcall TPrinterSettings(void);
  150.     __fastcall virtual ~TPrinterSettings(void);
  151.     void __fastcall ApplySettings(void);
  152.     __property System::AnsiString Device = {read=GetDriver};
  153.     __property System::AnsiString Driver = {read=GetDriver};
  154.     __property int LeftOffset = {read=GetLeftOffset, nodefault};
  155.     __property int MaxExtentX = {read=GetMaxExtentX, nodefault};
  156.     __property int MaxExtentY = {read=GetMaxExtentY, nodefault};
  157.     __property int MinExtentX = {read=GetMinExtentX, nodefault};
  158.     __property int MinExtentY = {read=GetMinExtentY, nodefault};
  159.     __property bool PaperSizeSupported[TQRPaperSize PaperSize] = {read=GetPaperSizeSupported};
  160.     __property int PixelsPerX = {read=GetPixelsPerX, nodefault};
  161.     __property int PixelsPerY = {read=GetPixelsPerY, nodefault};
  162.     __property System::AnsiString Port = {read=GetPort};
  163.     __property int TopOffset = {read=GetTopOffset, nodefault};
  164.     __property int Copies = {read=GetCopies, write=SetCopies, nodefault};
  165.     __property bool Duplex = {read=GetDuplex, write=SetDuplex, nodefault};
  166.     __property Printers::TPrinterOrientation Orientation = {read=GetOrientation, write=SetOrientation, 
  167.         nodefault};
  168.     __property TQRBin OutputBin = {read=GetOutputBin, write=SetOutputBin, nodefault};
  169.     __property int PaperLength = {read=GetPaperLength, write=SetPaperLength, nodefault};
  170.     __property TQRPaperSize PaperSize = {read=GetPaperSize, write=SetPaperSize, nodefault};
  171.     __property int PaperWidth = {read=GetPaperWidth, write=SetPaperWidth, nodefault};
  172.     __property Printers::TPrinter* Printer = {read=GetPrinter, write=SetPrinter};
  173.     __property System::AnsiString Title = {read=GetTitle, write=SetTitle};
  174. };
  175.  
  176. class DELPHICLASS TQRStream;
  177. class PASCALIMPLEMENTATION TQRStream : public Classes::TStream 
  178. {
  179.     typedef Classes::TStream inherited;
  180.     
  181. private:
  182.     _RTL_CRITICAL_SECTION FLock;
  183.     Classes::TMemoryStream* MemoryStream;
  184.     System::AnsiString FFilename;
  185.     Classes::TFileStream* FileStream;
  186.     bool FInMemory;
  187.     int FMemoryLimit;
  188.     
  189. public:
  190.     __fastcall TQRStream(int MemoryLimit);
  191.     __fastcall TQRStream(System::AnsiString Filename);
  192.     __fastcall virtual ~TQRStream(void);
  193.     virtual int __fastcall Write(const void *Buffer, int Count);
  194.     virtual int __fastcall Seek(int Offset, Word Origin);
  195.     virtual int __fastcall Read(void *Buffer, int Count);
  196.     void __fastcall LockStream(void);
  197.     void __fastcall UnlockStream(void);
  198.     void __fastcall SaveToStream(Classes::TStream* AStream);
  199.     __property bool InMemory = {read=FInMemory, nodefault};
  200. };
  201.  
  202. typedef void __fastcall (__closure *TQRAfterPrintEvent)(System::TObject* Sender);
  203.  
  204. typedef void __fastcall (__closure *TQRAfterPreviewEvent)(System::TObject* Sender);
  205.  
  206. enum TQRPrinterDestination { qrdMetafile, qrdPrinter };
  207.  
  208. typedef void __fastcall (__closure *TQRGenerateToPrinterEvent)(void);
  209.  
  210. class DELPHICLASS TQRExportFilter;
  211. typedef void __fastcall (__closure *TQRExportToFilterEvent)(TQRExportFilter* aFilter);
  212.  
  213. typedef void __fastcall (__closure *TQRPrintSetupEvent)(void);
  214.  
  215. enum TQRPrinterStatus { mpReady, mpBusy, mpFinished };
  216.  
  217. class DELPHICLASS TQRPageList;
  218. class DELPHICLASS TQRCompress;
  219. class PASCALIMPLEMENTATION TQRCompress : public System::TObject 
  220. {
  221.     typedef System::TObject inherited;
  222.     
  223. private:
  224.     Byte BitPos;
  225.     bool CompressFlag;
  226.     CodeType InByte;
  227.     DownIndex Left[256];
  228.     DownIndex Right[256];
  229.     CodeType OutByte;
  230.     Classes::TStream* Stream;
  231.     UpIndex Up[513];
  232.     Byte __fastcall GetByte(void);
  233.     void __fastcall InitializeSplay(void);
  234.     void __fastcall Splay(CodeType Plain);
  235.     
  236. public:
  237.     __fastcall TQRCompress(Classes::TStream* aStream, bool CompressData);
  238.     __fastcall virtual ~TQRCompress(void);
  239.     void __fastcall Expand(Byte &Expanded);
  240.     void __fastcall Compress(CodeType Plain);
  241. };
  242.  
  243. class PASCALIMPLEMENTATION TQRPageList : public System::TObject 
  244. {
  245.     typedef System::TObject inherited;
  246.     
  247. private:
  248.     _RTL_CRITICAL_SECTION FLock;
  249.     TQRCompress* aCompressor;
  250.     bool FCompression;
  251.     int FPageCount;
  252.     TQRStream* FStream;
  253.     void __fastcall SeekToFirst(void);
  254.     void __fastcall SeekToLast(void);
  255.     void __fastcall SeekToPage(int PageNumber);
  256.     void __fastcall ReadFileHeader(void);
  257.     void __fastcall WriteFileHeader(void);
  258.     
  259. public:
  260.     __fastcall TQRPageList(void);
  261.     __fastcall virtual ~TQRPageList(void);
  262.     Graphics::TMetafile* __fastcall GetPage(int PageNumber);
  263.     void __fastcall AddPage(Graphics::TMetafile* aMetafile);
  264.     void __fastcall Clear(void);
  265.     void __fastcall Finish(void);
  266.     void __fastcall LoadFromFile(System::AnsiString Filename);
  267.     void __fastcall LockList(void);
  268.     void __fastcall SaveToFile(System::AnsiString Filename);
  269.     void __fastcall UnlockList(void);
  270.     __property bool Compression = {read=FCompression, write=FCompression, nodefault};
  271.     __property int PageCount = {read=FPageCount, nodefault};
  272.     __property TQRStream* Stream = {read=FStream, write=FStream};
  273. };
  274.  
  275. class PASCALIMPLEMENTATION TQRPrinter : public Classes::TPersistent 
  276. {
  277.     typedef Classes::TPersistent inherited;
  278.     
  279. private:
  280.     Printers::TPrinter* aPrinter;
  281.     TPrinterSettings* aPrinterSettings;
  282.     TQRStream* aStream;
  283.     TQRAfterPrintEvent FAfterPrintEvent;
  284.     TQRAfterPreviewEvent FAfterPreviewEvent;
  285.     int FAvailablePages;
  286.     bool FCancelled;
  287.     Graphics::TCanvas* FCanvas;
  288.     TQRPrinterDestination FDestination;
  289.     int FFirstPage;
  290.     int FLastpage;
  291.     int FLeftWaste;
  292.     Controls::TWinControl* FMessageReceiver;
  293.     Graphics::TMetafile* FMetafile;
  294.     TQRGenerateToPrinterEvent FOnGenerateToPrinterEvent;
  295.     TQRExportToFilterEvent FOnExportToFilterEvent;
  296.     Classes::TNotifyEvent FOnPreviewEvent;
  297.     TQRPrintSetupEvent FOnPrintSetupEvent;
  298.     Graphics::TMetafile* FPage;
  299.     int FPageCount;
  300.     int FPageNumber;
  301.     bool FPrinterOK;
  302.     int FProgress;
  303.     System::AnsiString FTitle;
  304.     int FTopWaste;
  305.     bool FShowingPreview;
  306.     TQRPrinterStatus FStatus;
  307.     Extended FXFactor;
  308.     Extended FYFactor;
  309.     TQRPageList* PageList;
  310.     bool __fastcall CurrentPageOK(void);
  311.     int __fastcall GetLeftWaste(void);
  312.     TQRBin __fastcall GetBin(void);
  313.     Graphics::TCanvas* __fastcall GetCanvas(void);
  314.     bool __fastcall GetCompression(void);
  315.     int __fastcall GetCopies(void);
  316.     bool __fastcall GetDuplex(void);
  317.     Printers::TPrinterOrientation __fastcall GetOrientation(void);
  318.     int __fastcall GetPaperLength(void);
  319.     TQRPaperSize __fastcall GetPaperSize(void);
  320.     int __fastcall GetPaperWidth(void);
  321.     int __fastcall GetPrinterIndex(void);
  322.     Classes::TStrings* __fastcall GetPrinters(void);
  323.     int __fastcall GetTopWaste(void);
  324.     void __fastcall CreateMetafileCanvas(void);
  325.     void __fastcall CreatePrinterCanvas(void);
  326.     void __fastcall EndMetafileCanvas(void);
  327.     void __fastcall EndPrinterCanvas(void);
  328.     void __fastcall SetAvailablePages(int Value);
  329.     void __fastcall SetBin(TQRBin Value);
  330.     void __fastcall SetCompression(bool Value);
  331.     void __fastcall SetCopies(int Value);
  332.     void __fastcall SetDestination(TQRPrinterDestination Value);
  333.     void __fastcall SetDuplex(bool Value);
  334.     void __fastcall SetOrientation(Printers::TPrinterOrientation Value);
  335.     void __fastcall SetPaperLength(int Value);
  336.     void __fastcall SetPageNumber(int Value);
  337.     void __fastcall SetPaperSize(TQRPaperSize Value);
  338.     void __fastcall SetPaperWidth(int Value);
  339.     void __fastcall SetPrinterIndex(int Value);
  340.     void __fastcall SetProgress(int Value);
  341.     void __fastcall SetShowingPreview(bool Value);
  342.     
  343. public:
  344.     __fastcall TQRPrinter(void);
  345.     __fastcall virtual ~TQRPrinter(void);
  346.     Graphics::TMetafile* __fastcall GetPage(int Value);
  347.     int __fastcall XPos(Extended Value);
  348.     int __fastcall XSize(Extended Value);
  349.     int __fastcall YPos(Extended Value);
  350.     int __fastcall YSize(Extended Value);
  351.     int __fastcall PaperLengthValue(void);
  352.     int __fastcall PaperWidthValue(void);
  353.     void __fastcall AbortDoc(void);
  354.     void __fastcall BeginDoc(void);
  355.     void __fastcall Cancel(void);
  356.     void __fastcall Cleanup(void);
  357.     void __fastcall EndDoc(void);
  358.     void __fastcall ExportToFilter(TQRExportFilter* aFilter);
  359.     void __fastcall Load(System::AnsiString Filename);
  360.     void __fastcall NewPage(void);
  361.     void __fastcall Preview(void);
  362.     void __fastcall Print(void);
  363.     void __fastcall PrintSetup(void);
  364.     void __fastcall Save(System::AnsiString Filename);
  365.     __property TQRAfterPreviewEvent AfterPreview = {read=FAfterPreviewEvent, write=FAfterPreviewEvent};
  366.         
  367.     __property TQRAfterPrintEvent AfterPrint = {read=FAfterPrintEvent, write=FAfterPrintEvent};
  368.     __property int AvailablePages = {read=FAvailablePages, write=SetAvailablePages, nodefault};
  369.     __property TQRBin OutputBin = {read=GetBin, write=SetBin, nodefault};
  370.     __property bool Cancelled = {read=FCancelled, write=FCancelled, nodefault};
  371.     __property Graphics::TCanvas* Canvas = {read=GetCanvas};
  372.     __property bool Compression = {read=GetCompression, write=SetCompression, nodefault};
  373.     __property int Copies = {read=GetCopies, write=SetCopies, nodefault};
  374.     __property TQRPrinterDestination Destination = {read=FDestination, write=SetDestination, nodefault}
  375.         ;
  376.     __property bool Duplex = {read=GetDuplex, write=SetDuplex, nodefault};
  377.     __property int FirstPage = {read=FFirstPage, write=FFirstPage, nodefault};
  378.     __property int LastPage = {read=FLastpage, write=FLastpage, nodefault};
  379.     __property int LeftWaste = {read=GetLeftWaste, nodefault};
  380.     __property Controls::TWinControl* MessageReceiver = {read=FMessageReceiver, write=FMessageReceiver}
  381.         ;
  382.     __property Printers::TPrinterOrientation Orientation = {read=GetOrientation, write=SetOrientation, 
  383.         nodefault};
  384.     __property TQRExportToFilterEvent OnExportToFilter = {read=FOnExportToFilterEvent, write=FOnExportToFilterEvent
  385.         };
  386.     __property TQRGenerateToPrinterEvent OnGenerateToPrinter = {read=FOnGenerateToPrinterEvent, write=FOnGenerateToPrinterEvent
  387.         };
  388.     __property Classes::TNotifyEvent OnPreview = {read=FOnPreviewEvent, write=FOnPreviewEvent};
  389.     __property TQRPrintSetupEvent OnPrintSetup = {read=FOnPrintSetupEvent, write=FOnPrintSetupEvent};
  390.     __property int PaperLength = {read=GetPaperLength, write=SetPaperLength, nodefault};
  391.     __property Graphics::TMetafile* Page = {read=FPage};
  392.     __property int PageCount = {read=FPageCount, write=FPageCount, nodefault};
  393.     __property int PageNumber = {read=FPageNumber, write=SetPageNumber, nodefault};
  394.     __property int PaperWidth = {read=GetPaperWidth, write=SetPaperWidth, nodefault};
  395.     __property TQRPaperSize PaperSize = {read=GetPaperSize, write=SetPaperSize, nodefault};
  396.     __property int PrinterIndex = {read=GetPrinterIndex, write=SetPrinterIndex, nodefault};
  397.     __property bool PrinterOK = {read=FPrinterOK, nodefault};
  398.     __property Classes::TStrings* Printers = {read=GetPrinters};
  399.     __property int Progress = {read=FProgress, write=SetProgress, nodefault};
  400.     __property bool ShowingPreview = {read=FShowingPreview, write=SetShowingPreview, nodefault};
  401.     __property TQRPrinterStatus Status = {read=FStatus, nodefault};
  402.     __property System::AnsiString Title = {read=FTitle, write=FTitle};
  403.     __property int TopWaste = {read=GetTopWaste, nodefault};
  404.     __property Extended XFactor = {read=FXFactor, write=FXFactor};
  405.     __property Extended YFactor = {read=FYFactor, write=FYFactor};
  406. };
  407.  
  408. struct TCM_QRPRogressUpdate
  409. {
  410.     Cardinal Msg;
  411.     Word Position;
  412.     TQRPrinter* QRPrinter;
  413. } ;
  414.  
  415. struct TCM_QRPageAvailable
  416. {
  417.     Cardinal Msg;
  418.     Word PageCount;
  419.     TQRPrinter* QRPrinter;
  420. } ;
  421.  
  422. typedef System::TMetaClass*TQRExportFilterClass;
  423.  
  424. class DELPHICLASS TQRExportFilterLibraryEntry;
  425. class PASCALIMPLEMENTATION TQRExportFilterLibraryEntry : public System::TObject 
  426. {
  427.     typedef System::TObject inherited;
  428.     
  429. private:
  430.     System::TMetaClass*FExportFilterClass;
  431.     System::AnsiString FName;
  432.     System::AnsiString FExtension;
  433.     
  434. public:
  435.     __property System::TMetaClass* ExportFilterClass = {read=FExportFilterClass, write=FExportFilterClass
  436.         };
  437.     __property System::AnsiString FilterName = {read=FName, write=FName};
  438.     __property System::AnsiString Extension = {read=FExtension, write=FExtension};
  439. public:
  440.     /* TObject.Create */ __fastcall TQRExportFilterLibraryEntry(void) : System::TObject() { }
  441.     /* TObject.Destroy */ __fastcall virtual ~TQRExportFilterLibraryEntry(void) { }
  442.     
  443. };
  444.  
  445. class DELPHICLASS TQRExportFilterLibrary;
  446. class PASCALIMPLEMENTATION TQRExportFilterLibrary : public System::TObject 
  447. {
  448.     typedef System::TObject inherited;
  449.     
  450. private:
  451.     Classes::TList* FFilterList;
  452.     
  453. protected:
  454.     System::AnsiString __fastcall GetSaveDialogFilter(void);
  455.     
  456. public:
  457.     __fastcall TQRExportFilterLibrary(void);
  458.     __fastcall virtual ~TQRExportFilterLibrary(void);
  459.     void __fastcall AddFilter(System::TMetaClass* AFilter);
  460.     __property Classes::TList* Filters = {read=FFilterList};
  461.     __property System::AnsiString SaveDialogFilterString = {read=GetSaveDialogFilter};
  462. };
  463.  
  464. typedef System::TMetaClass*TQRLibraryItemClass;
  465.  
  466. class DELPHICLASS TQRLibraryEntry;
  467. class PASCALIMPLEMENTATION TQRLibraryEntry : public System::TObject 
  468. {
  469.     typedef System::TObject inherited;
  470.     
  471. private:
  472.     System::AnsiString FDescription;
  473.     System::AnsiString FData;
  474.     System::TMetaClass*FItem;
  475.     System::AnsiString FName;
  476.     System::AnsiString FVendor;
  477.     
  478. public:
  479.     __property System::AnsiString Data = {read=FData, write=FData};
  480.     __property System::AnsiString Description = {read=FDescription, write=FDescription};
  481.     __property System::AnsiString Name = {read=FName, write=FName};
  482.     __property System::AnsiString Vendor = {read=FVendor, write=FVendor};
  483.     __property System::TMetaClass* Item = {read=FItem, write=FItem};
  484. public:
  485.     /* TObject.Create */ __fastcall TQRLibraryEntry(void) : System::TObject() { }
  486.     /* TObject.Destroy */ __fastcall virtual ~TQRLibraryEntry(void) { }
  487.     
  488. };
  489.  
  490. class DELPHICLASS TQRLibrary;
  491. class PASCALIMPLEMENTATION TQRLibrary : public System::TObject 
  492. {
  493.     typedef System::TObject inherited;
  494.     
  495. private:
  496.     Classes::TStrings* Entries;
  497.     
  498. protected:
  499.     virtual TQRLibraryEntry* __fastcall GetEntry(int Index);
  500.     
  501. public:
  502.     __fastcall TQRLibrary(void);
  503.     __fastcall virtual ~TQRLibrary(void);
  504.     void __fastcall Add(System::TMetaClass* aItem, System::AnsiString AName, System::AnsiString ADescription
  505.         , System::AnsiString AVendor, System::AnsiString AData);
  506.     __property Classes::TStrings* EntryList = {read=Entries, write=Entries};
  507.     __property TQRLibraryEntry* Entry[int Index] = {read=GetEntry};
  508. };
  509.  
  510. class DELPHICLASS TQRFunctionLibrary;
  511. class DELPHICLASS TQREvElement;
  512. class PASCALIMPLEMENTATION TQRFunctionLibrary : public Qrprntr::TQRLibrary 
  513. {
  514.     typedef Qrprntr::TQRLibrary inherited;
  515.     
  516. public:
  517.     TQREvElement* __fastcall GetFunction(System::AnsiString Name);
  518. public:
  519.     /* TQRLibrary.Create */ __fastcall TQRFunctionLibrary(void) : Qrprntr::TQRLibrary() { }
  520.     /* TQRLibrary.Destroy */ __fastcall virtual ~TQRFunctionLibrary(void) { }
  521.     
  522. };
  523.  
  524. class DELPHICLASS TQRToolbar;
  525. class PASCALIMPLEMENTATION TQRToolbar : public Extctrls::TCustomPanel 
  526. {
  527.     typedef Extctrls::TCustomPanel inherited;
  528.     
  529. private:
  530.     Classes::TComponent* FComponent;
  531.     int FCurrentX;
  532.     bool FCBClickOK;
  533.     
  534. protected:
  535.     Buttons::TSpeedButton* __fastcall AddButton(System::AnsiString aCaption, System::AnsiString GlyphName
  536.         , System::AnsiString aHint, int aGroup, Classes::TNotifyEvent ClickEvent);
  537.     Stdctrls::TCheckBox* __fastcall AddCheckBox(System::AnsiString aCaption, System::AnsiString aHint, 
  538.         Classes::TNotifyEvent ClickEvent);
  539.     void __fastcall AddSpace(void);
  540.     virtual void __fastcall SetComponent(Classes::TComponent* Value);
  541.     void __fastcall EndSetComponent(void);
  542.     __property bool CBClickOK = {read=FCBClickOK, write=FCBClickOK, nodefault};
  543.     __property int CurrentX = {read=FCurrentX, write=FCurrentX, nodefault};
  544.     
  545. public:
  546.     __fastcall virtual TQRToolbar(Classes::TComponent* AOwner);
  547.     __property Classes::TComponent* Component = {read=FComponent, write=SetComponent};
  548. public:
  549.     /* TCustomControl.Destroy */ __fastcall virtual ~TQRToolbar(void) { }
  550.     
  551. public:
  552.     /* TWinControl.CreateParented */ __fastcall TQRToolbar(HWND ParentWindow) : Extctrls::TCustomPanel(
  553.         ParentWindow) { }
  554.     
  555. };
  556.  
  557. class DELPHICLASS TQRGauge;
  558. class PASCALIMPLEMENTATION TQRGauge : public Comctrls::TProgressBar 
  559. {
  560.     typedef Comctrls::TProgressBar inherited;
  561.     
  562. public:
  563.     __fastcall virtual TQRGauge(Classes::TComponent* AOwner);
  564. public:
  565.     /* TWinControl.CreateParented */ __fastcall TQRGauge(HWND ParentWindow) : Comctrls::TProgressBar(ParentWindow
  566.         ) { }
  567.     /* TWinControl.Destroy */ __fastcall virtual ~TQRGauge(void) { }
  568.     
  569. };
  570.  
  571. enum TQREvOperator { opLess, opLessOrEqual, opGreater, opGreaterOrEqual, opEqual, opUnequal, opPlus, 
  572.     opMinus, opOr, opMul, opDiv, opAnd };
  573.  
  574. enum TQREvResultType { resInt, resDouble, resString, resBool, resError };
  575.  
  576. struct TQREvResult
  577. {
  578.     
  579.     TQREvResultType Kind;
  580.     union
  581.     {
  582.         bool booResult;
  583.         System::SmallStringBase<255>  strResult;
  584.         double dblResult;
  585.         int intResult;
  586.         
  587.     };
  588. } ;
  589.  
  590. class DELPHICLASS TQREvResultClass;
  591. class PASCALIMPLEMENTATION TQREvResultClass : public System::TObject 
  592. {
  593.     typedef System::TObject inherited;
  594.     
  595. public:
  596.     TQREvResult EvResult;
  597. public:
  598.     /* TObject.Create */ __fastcall TQREvResultClass(void) : System::TObject() { }
  599.     /* TObject.Destroy */ __fastcall virtual ~TQREvResultClass(void) { }
  600.     
  601. };
  602.  
  603. class DELPHICLASS TQRFiFo;
  604. class PASCALIMPLEMENTATION TQRFiFo : public System::TObject 
  605. {
  606.     typedef System::TObject inherited;
  607.     
  608. private:
  609.     bool FAggreg;
  610.     Classes::TList* FiFo;
  611.     int FNextItem;
  612.     
  613. public:
  614.     __fastcall TQRFiFo(void);
  615.     __fastcall virtual ~TQRFiFo(void);
  616.     void __fastcall Put(System::TObject* Value);
  617.     void __fastcall Start(void);
  618.     System::TObject* __fastcall Get(void);
  619.     System::TObject* __fastcall GetAndFree(void);
  620.     __property bool Aggreg = {read=FAggreg, write=FAggreg, nodefault};
  621. };
  622.  
  623. class PASCALIMPLEMENTATION TQREvElement : public System::TObject 
  624. {
  625.     typedef System::TObject inherited;
  626.     
  627. private:
  628.     bool FIsAggreg;
  629.     
  630. public:
  631.     __fastcall virtual TQREvElement(void);
  632.     virtual TQREvResult __fastcall Value(TQRFiFo* FiFo);
  633.     virtual void __fastcall Reset(void);
  634.     __property bool IsAggreg = {read=FIsAggreg, write=FIsAggreg, nodefault};
  635. public:
  636.     /* TObject.Destroy */ __fastcall virtual ~TQREvElement(void) { }
  637.     
  638. };
  639.  
  640. class DELPHICLASS TQREvElementFunction;
  641. class PASCALIMPLEMENTATION TQREvElementFunction : public Qrprntr::TQREvElement 
  642. {
  643.     typedef Qrprntr::TQREvElement inherited;
  644.     
  645. protected:
  646.     Classes::TList* ArgList;
  647.     bool __fastcall ArgumentOK(TQREvElement* Value);
  648.     TQREvResult __fastcall Argument(int Index);
  649.     void __fastcall FreeArguments(void);
  650.     void __fastcall GetArguments(TQRFiFo* FiFo);
  651.     virtual void __fastcall Aggregate(void);
  652.     virtual TQREvResult __fastcall Calculate(void);
  653.     
  654. public:
  655.     __fastcall virtual TQREvElementFunction(void);
  656.     __fastcall virtual ~TQREvElementFunction(void);
  657.     virtual TQREvResult __fastcall Value(TQRFiFo* FiFo);
  658. };
  659.  
  660. typedef System::TMetaClass*TQREvElementFunctionClass;
  661.  
  662. class DELPHICLASS TQREvElementArgumentEnd;
  663. class PASCALIMPLEMENTATION TQREvElementArgumentEnd : public Qrprntr::TQREvElement 
  664. {
  665.     typedef Qrprntr::TQREvElement inherited;
  666.     
  667. public:
  668.     /* TQREvElement.Create */ __fastcall virtual TQREvElementArgumentEnd(void) : Qrprntr::TQREvElement(
  669.         ) { }
  670.     
  671. public:
  672.     /* TObject.Destroy */ __fastcall virtual ~TQREvElementArgumentEnd(void) { }
  673.     
  674. };
  675.  
  676. class DELPHICLASS TQREvElementDataField;
  677. class PASCALIMPLEMENTATION TQREvElementDataField : public Qrprntr::TQREvElement 
  678. {
  679.     typedef Qrprntr::TQREvElement inherited;
  680.     
  681. private:
  682.     Db::TDataSet* FDataSet;
  683.     int FFieldNo;
  684.     Db::TField* FField;
  685.     
  686. public:
  687.     __fastcall virtual TQREvElementDataField(Db::TField* aField);
  688.     virtual TQREvResult __fastcall Value(TQRFiFo* FiFo);
  689. public:
  690.     /* TQREvElement.Create */ __fastcall virtual TQREvElementDataField(void) : Qrprntr::TQREvElement() { }
  691.         
  692.     
  693. public:
  694.     /* TObject.Destroy */ __fastcall virtual ~TQREvElementDataField(void) { }
  695.     
  696. };
  697.  
  698. class DELPHICLASS TQREvElementError;
  699. class PASCALIMPLEMENTATION TQREvElementError : public Qrprntr::TQREvElement 
  700. {
  701.     typedef Qrprntr::TQREvElement inherited;
  702.     
  703. public:
  704.     virtual TQREvResult __fastcall Value(TQRFiFo* FiFo);
  705. public:
  706.     /* TQREvElement.Create */ __fastcall virtual TQREvElementError(void) : Qrprntr::TQREvElement() { }
  707.     
  708. public:
  709.     /* TObject.Destroy */ __fastcall virtual ~TQREvElementError(void) { }
  710.     
  711. };
  712.  
  713. class DELPHICLASS TQREvaluator;
  714. class PASCALIMPLEMENTATION TQREvaluator : public System::TObject 
  715. {
  716.     typedef System::TObject inherited;
  717.     
  718. private:
  719.     Classes::TList* FDataSets;
  720.     TQRFiFo* FiFo;
  721.     bool FPrepared;
  722.     TQREvResult __fastcall EvalFunctionExpr(const System::AnsiString strFunc);
  723.     TQREvResult __fastcall EvalSimpleExpr(const System::AnsiString strSimplExpr);
  724.     TQREvResult __fastcall EvalTerm(const System::AnsiString strTermExpr);
  725.     TQREvResult __fastcall EvalFactor(System::AnsiString strFactorExpr);
  726.     TQREvResult __fastcall EvalString(const System::AnsiString strString);
  727.     TQREvResult __fastcall EvalConstant(const System::AnsiString strConstant);
  728.     bool __fastcall GetAggregate(void);
  729.     TQREvResult __fastcall NegateResult(const TQREvResult &Res);
  730.     TQREvResult __fastcall Evaluate(const System::AnsiString strExpr);
  731.     void __fastcall FindDelimiter(System::AnsiString strArg, int &Pos);
  732.     void __fastcall FindOp1(const System::AnsiString strExpr, TQREvOperator &Op, int &Pos, int &Len);
  733.     void __fastcall FindOp2(const System::AnsiString strExpr, TQREvOperator &Op, int &Pos, int &Len);
  734.     void __fastcall FindOp3(const System::AnsiString strExpr, TQREvOperator &Op, int &Pos, int &Len);
  735.     void __fastcall SetAggregate(bool Value);
  736.     void __fastcall TrimString(System::AnsiString &strString);
  737.     
  738. protected:
  739.     virtual TQREvResult __fastcall EvalFunction(System::AnsiString strFunc, const System::AnsiString strArg
  740.         );
  741.     virtual TQREvResult __fastcall EvalVariable(System::AnsiString strVariable);
  742.     bool __fastcall GetIsAggreg(void);
  743.     
  744. public:
  745.     __fastcall TQREvaluator(void);
  746.     __fastcall virtual ~TQREvaluator(void);
  747.     TQREvResult __fastcall Calculate(const System::AnsiString StrExpr);
  748.     TQREvResult __fastcall Value(void);
  749.     void __fastcall Prepare(const System::AnsiString StrExpr);
  750.     void __fastcall Reset(void);
  751.     void __fastcall UnPrepare(void);
  752.     __property bool IsAggreg = {read=GetIsAggreg, nodefault};
  753.     __property bool Aggregate = {read=GetAggregate, write=SetAggregate, nodefault};
  754.     __property Classes::TList* DataSets = {read=FDataSets, write=FDataSets};
  755.     __property bool Prepared = {read=FPrepared, write=FPrepared, nodefault};
  756. };
  757.  
  758. enum TQRZoomState { qrZoomToFit, qrZoomToWidth, qrZoomOther };
  759.  
  760. class DELPHICLASS TQRPreviewImage;
  761. class PASCALIMPLEMENTATION TQRPreviewImage : public Controls::TGraphicControl 
  762. {
  763.     typedef Controls::TGraphicControl inherited;
  764.     
  765. private:
  766.     TQRPrinter* FQRPrinter;
  767.     int FPageNumber;
  768.     Graphics::TMetafile* aMetaFile;
  769.     bool FImageOK;
  770.     void __fastcall PaintPage(void);
  771.     void __fastcall SetPageNumber(int Value);
  772.     
  773. public:
  774.     int Zoom;
  775.     __fastcall virtual TQRPreviewImage(Classes::TComponent* AOwner);
  776.     __fastcall virtual ~TQRPreviewImage(void);
  777.     virtual void __fastcall Paint(void);
  778.     __property bool ImageOK = {read=FImageOK, write=FImageOK, nodefault};
  779.     __property int PageNumber = {read=FPageNumber, write=SetPageNumber, nodefault};
  780.     __property TQRPrinter* QRPrinter = {read=FQRPrinter, write=FQRPrinter};
  781. };
  782.  
  783. typedef void __fastcall (__closure *TQRProgressUpdateEvent)(System::TObject* Sender, int Progress);
  784.  
  785. typedef void __fastcall (__closure *TQRPageAvailableEvent)(System::TObject* Sender, int PageNum);
  786.  
  787. class DELPHICLASS TQRPreview;
  788. class PASCALIMPLEMENTATION TQRPreview : public Forms::TScrollBox 
  789. {
  790.     typedef Forms::TScrollBox inherited;
  791.     
  792. private:
  793.     TQRPageAvailableEvent FOnPageAvailableEvent;
  794.     TQRProgressUpdateEvent FOnProgressUpdateEvent;
  795.     TQRPreviewImage* FPreviewImage;
  796.     int FPageNumber;
  797.     TQRPrinter* FQRPrinter;
  798.     int FZoom;
  799.     TQRZoomState FZoomState;
  800.     void __fastcall SetPageNumber(int Value);
  801.     void __fastcall SetZoom(int value);
  802.     void __fastcall Fixvalues(System::TObject* Sender);
  803.     void __fastcall SetQRPrinter(TQRPrinter* Value);
  804.     
  805. protected:
  806.     MESSAGE void __fastcall CMPageAvailable(TCM_QRPageAvailable &Message);
  807.     MESSAGE void __fastcall CMProgressUpdate(TCM_QRPRogressUpdate &Message);
  808.     
  809. public:
  810.     __fastcall virtual TQRPreview(Classes::TComponent* aOwner);
  811.     __fastcall virtual ~TQRPreview(void);
  812.     void __fastcall UpdateImage(void);
  813.     void __fastcall UpdateZoom(void);
  814.     void __fastcall ZoomToWidth(void);
  815.     void __fastcall ZoomToFit(void);
  816.     __property TQRPreviewImage* PreviewImage = {read=FPreviewImage};
  817.     __property TQRPrinter* QRPrinter = {read=FQRPrinter, write=SetQRPrinter};
  818.     __property TQRZoomState ZoomState = {read=FZoomState, write=FZoomState, nodefault};
  819.     
  820. __published:
  821.     __property TQRPageAvailableEvent OnPageAvailable = {read=FOnPageAvailableEvent, write=FOnPageAvailableEvent
  822.         };
  823.     __property TQRProgressUpdateEvent OnProgressUpdate = {read=FOnProgressUpdateEvent, write=FOnProgressUpdateEvent
  824.         };
  825.     __property int PageNumber = {read=FPageNumber, write=SetPageNumber, nodefault};
  826.     __property int Zoom = {read=FZoom, write=SetZoom, nodefault};
  827. public:
  828.     /* TWinControl.CreateParented */ __fastcall TQRPreview(HWND ParentWindow) : Forms::TScrollBox(ParentWindow
  829.         ) { }
  830.     
  831. };
  832.  
  833. class PASCALIMPLEMENTATION TQRExportFilter : public System::TObject 
  834. {
  835.     typedef System::TObject inherited;
  836.     
  837. private:
  838.     System::AnsiString FFilename;
  839.     Classes::TComponent* FOwner;
  840.     
  841. protected:
  842.     virtual System::AnsiString __fastcall GetDescription(void);
  843.     virtual System::AnsiString __fastcall GetExtension(void);
  844.     virtual System::AnsiString __fastcall GetFilterName(void);
  845.     virtual System::AnsiString __fastcall GetVendorName(void);
  846.     
  847. public:
  848.     __fastcall TQRExportFilter(System::AnsiString Filename);
  849.     virtual void __fastcall Start(int PaperWidth, int PaperHeight, Graphics::TFont* Font);
  850.     virtual void __fastcall EndPage(void);
  851.     virtual void __fastcall Finish(void);
  852.     virtual void __fastcall NewPage(void);
  853.     virtual void __fastcall TextOut(Extended X, Extended Y, Graphics::TFont* Font, Graphics::TColor BGColor
  854.         , Classes::TAlignment Alignment, System::AnsiString Text);
  855.     __property System::AnsiString Description = {read=GetDescription};
  856.     __property System::AnsiString FileExtension = {read=GetExtension};
  857.     __property System::AnsiString Filename = {read=FFilename};
  858.     __property System::AnsiString Name = {read=GetFilterName};
  859.     __property Classes::TComponent* Owner = {read=FOwner, write=FOwner};
  860.     __property System::AnsiString Vendor = {read=GetVendorName};
  861. public:
  862.     /* TObject.Destroy */ __fastcall virtual ~TQRExportFilter(void) { }
  863.     
  864. };
  865.  
  866. class DELPHICLASS TQRPrinterSettings;
  867. class PASCALIMPLEMENTATION TQRPrinterSettings : public Classes::TPersistent 
  868. {
  869.     typedef Classes::TPersistent inherited;
  870.     
  871. private:
  872.     int FCopies;
  873.     bool FDuplex;
  874.     TPrinterOrientation FOrientation;
  875.     TQRBin FOutputBin;
  876.     TQRPaperSize FPaperSize;
  877.     int FPrinterIndex;
  878.     System::AnsiString FTitle;
  879.     int FFirstPage;
  880.     int FLastPage;
  881.     
  882. public:
  883.     __fastcall TQRPrinterSettings(void);
  884.     void __fastcall ApplySettings(TQRPrinter* APrinter);
  885.     __property int Copies = {read=FCopies, write=FCopies, nodefault};
  886.     __property bool Duplex = {read=FDuplex, write=FDuplex, nodefault};
  887.     __property int FirstPage = {read=FFirstPage, write=FFirstPage, nodefault};
  888.     __property int LastPage = {read=FLastPage, write=FLastPage, nodefault};
  889.     __property Printers::TPrinterOrientation Orientation = {read=FOrientation, write=FOrientation, nodefault
  890.         };
  891.     __property TQRBin OutputBin = {read=FOutputBin, write=FOutputBin, nodefault};
  892.     __property TQRPaperSize PaperSize = {read=FPaperSize, write=FPaperSize, nodefault};
  893.     __property int PrinterIndex = {read=FPrinterIndex, write=FPrinterIndex, nodefault};
  894.     __property System::AnsiString Title = {read=FTitle, write=FTitle};
  895. public:
  896.     /* TPersistent.Destroy */ __fastcall virtual ~TQRPrinterSettings(void) { }
  897.     
  898. };
  899.  
  900. typedef void __fastcall (__closure *TQRPreviewEvent)(void);
  901.  
  902. //-- var, const, procedure ---------------------------------------------------
  903. #define cQRName "QuickReport 2.0k"
  904. #define cQRVersion (Byte)(212)
  905. #define cQRPDefaultExt "QRP"
  906. #define cQRDefaultExt "QR"
  907. extern PACKAGE Extended cQRPaperSizeMetrics[26][2];
  908. extern PACKAGE int cQRPaperTranslate[28];
  909. extern PACKAGE int cQRBinTranslate[14];
  910. #define cHandleSize (Byte)(2)
  911. #define hpFirst (Byte)(1)
  912. #define hpLast (Byte)(8)
  913. #define hpNone (Byte)(0)
  914. #define hpTopLeft (Byte)(1)
  915. #define hpTop (Byte)(2)
  916. #define hpTopRight (Byte)(3)
  917. #define hpLeft (Byte)(4)
  918. #define hpRight (Byte)(5)
  919. #define hpBottomLeft (Byte)(6)
  920. #define hpBottom (Byte)(7)
  921. #define hpBottomRight (Byte)(8)
  922. #define cQRCornerSize (Byte)(4)
  923. #define cQRPageShadowWidth (Byte)(2)
  924. #define cQRPageFrameWidth (Byte)(1)
  925. #define cQRPageShadowColor (int)(0)
  926. #define cQRButtonSize (Byte)(24)
  927. #define cQRToolbarHeight (Byte)(30)
  928. #define cQRToolbarMargin (Byte)(4)
  929. #define cQRToolbarCBWidth (Byte)(80)
  930. #define cQRToolbarCBMargin (Byte)(8)
  931. #define MaxChar (Word)(256)
  932. #define EofChar (Word)(256)
  933. #define PredMax (Byte)(255)
  934. #define TwiceMax (Word)(512)
  935. #define ROOT (Byte)(0)
  936. extern PACKAGE Byte BitMask[8];
  937. #define CM_QRPROGRESSUPDATE (Word)(1024)
  938. #define CM_QRPAGEAVAILABLE (Word)(1025)
  939. extern PACKAGE TQRExportFilterLibrary* QRExportFilterLibrary;
  940. extern PACKAGE TQRFunctionLibrary* QRFunctionLibrary;
  941. extern PACKAGE System::AnsiString __fastcall QRPaperName(TQRPaperSize Size);
  942. extern PACKAGE System::AnsiString __fastcall QRBandTypeName(TQRBandType BandType);
  943. extern PACKAGE System::AnsiString __fastcall QRBandComponentName(TQRBandType BandType);
  944. extern PACKAGE System::AnsiString __fastcall TempFilename(void);
  945. extern PACKAGE Classes::TStrings* __fastcall GetFonts(void);
  946. extern PACKAGE void __fastcall RegisterQRFunction(System::TMetaClass* FunctionClass, System::AnsiString 
  947.     Name, System::AnsiString Description, System::AnsiString Vendor, System::AnsiString Arguments);
  948. extern PACKAGE TQRPrinter* __fastcall QRPrinter(void);
  949.  
  950. }    /* namespace Qrprntr */
  951. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  952. using namespace Qrprntr;
  953. #endif
  954. //-- end unit ----------------------------------------------------------------
  955. #endif    // qrprntr
  956.